
	******************************************************************
	**
	**
	**		NAME:		GUY GROSSMAN, YOTAM MARGALIT, TAMAR MITTS
	**		DATE: 		December 15, 2021
	**		PROJECT: 	Israel Hayom
	**		DETAILS: 	This code generates Table SI-6
	**		Version: 	Stata MP 16
	**
	******************************************************************
	
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**

clear
version 16
set scheme plotplain
set more off

capture cd "~/dropbox/Israeli Newspapers Study/JOP_REPLICATION/Dataverse submission"

* bring in period dataset at locality level

use "Data/yeshuv_period_final_Figs.dta", clear
tsset uniqueid period
sort uniqueid period
	
// define covariates
gl interactions i.period#c.ltd i.period#c.lpop i.period#c.matriccert_pcnt_08 i.period#c.europe_pcnt_08 i.period#c.pop_share1829 i.period#c.pop_share3049 i.period#c.pop_share5065 i.period#c.pop_share66 i.period#c.religion_pcnt i.period#c.asia_pcnt_08
su $interactions

gl covs ltd lpop matriccert_pcnt_08 europe_pcnt_08 pop_share1829 pop_share3049 pop_share5065 pop_share66 asia_pcnt_08 religion_pcnt
su $covs

************************************************************************************************************
* Regression for the two-period FD with inverse hyperbolic sine (IHS transformation) Israel-Hayom exposure *
************************************************************************************************************

estimates drop _all

foreach var in BRB {  

* OLS model for 2009 - No covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D1 ihs_IHE `var'Pre if period==2  [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'13

* OLS model for 2009 - With covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D1 ihs_IHE `var'Pre $covs if period==2 [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'14

* OLS model for 2013 - No covariates
	
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D2 ihs_IHE `var'Pre if period==3  [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'15
	
* OLS model for 2013 - With covariates
		
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D2 ihs_IHE `var'Pre $covs if period==3 [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'16	
	
* OLS model for 2015 - No covariates
	
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D3 ihs_IHE `var'Pre if period==4 [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'17
	
* OLS model for 2015 - With covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: reg `var'D3 ihs_IHE `var'Pre $covs if period==4  [aw=potential], cl(area_num)
	estadd local Model "OLS"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'18	
	
* IV model for 2009 - No covariates
	
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D1 (ihs_IHE = IVsm) `var'Pre if period==2 [aw=potential],  cl(area_num)
	estadd local Model "IV"
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'IVsm13
	
* IV model for 2009 - With covariates
		
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D1 (ihs_IHE = IVsm) `var'Pre $covs if period==2  [aw=potential],  cl(area_num)
	estadd local Model "IV"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'IVsm14
	
* IV model for 2013 - No covariates
	
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D2 (ihs_IHE = IVsm) `var'Pre if period==3 [aw=potential],  cl(area_num)
	estadd local Model "IV"
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'IVsm15
	
* IV model for 2013 - With covariates
		
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D2 (ihs_IHE = IVsm) `var'Pre $covs if period==3  [aw=potential],  cl(area_num)
	estadd local Model "IV"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'IVsm16
	
* IV model for 2015 - No covariates
			
bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D3 (ihs_IHE = IVsm) `var'Pre if period==4  [aw=potential],  cl(area_num)
	estadd local Model "IV"	
	estadd local covs "no"
	estadd local base "yes"
	capture est sto `var'IVsm17
	
* IV model for 2015 - With covariates

bootstrap, reps(250) seed(1712) cl(area_num) idcl(new_area_num) group(uniqueid) force: ivreg2 `var'D3 (ihs_IHE = IVsm) `var'Pre $covs if period==4 [aw=potential],  cl(area_num)
	estadd local Model "IV"
	estadd local covs "yes"
	estadd local base "yes"
	capture est sto `var'IVsm18
	
	}
	
	* Outsheeting results to create Table SI-6
	
		# delimit ;
		esttab BRB13 BRB14 BRB15 BRB16 BRB17 BRB18 BRBIVsm13 BRBIVsm14 BRBIVsm15 BRBIVsm16 BRBIVsm17 BRBIVsm18
		using "Tables/Table_SI-6.tex", replace
		keep(ihs_IHE _cons)
		cells(b(fmt(%5.3f) star) se(fmt(%5.3f) par))
		starlevels(* .10 ** .05 *** .01) 
		mgroups( "\textbf{2009}" "\textbf{2013}" "\textbf{2015}" "\textbf{2009}" "\textbf{2013}" "\textbf{2015}", 
		pattern(1 0 1 0 1 0 1 0 1 0 1 0)
		span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) nomtitles
		varlabels(ihs_IHE "IH (ihs)" _cons "Constant")
		stats(Model covs base r2 N, labels("Model" "Covariates" "Base DV" "R2" "N")
		fmt(0 0 0 2 0)) collabels(none) label booktabs nonotes
		;
		#delimit cr		
